import upload from '@/utils/upload'
import request from '@/utils/request'

// 获取通知公告
export function getMessageListData(params) {
  return request({
    url: '/app/inform/page',
    method: 'GET',
    params
  })
}
// 获取首页待办事项、重要通知统计数量
export function getToDoNoticeCount(userId) {
  return request({
    url: '/app/inform/getIndexNum',
    method: 'GET',
    params: {
      userId
    }
  })
}
// 查询用户个人信息
export function getUserProfile() {
  return request({
    url: '/system/user/profile/get',
    method: 'GET'
  })
}

// 修改用户个人信息
export function updateUserProfile(data) {
  return request({
    url: '/system/user/profile/update',
    method: 'PUT',
    data: data
  })
}

// 用户头像上传
export function uploadAvatar(data) {
  return upload({
    url: '/system/user/profile/update-avatar',
    method: 'PUT',
    name: data.name,
    filePath: data.filePath
  })
}